<%@ include file="/common/taglibs.jsp"%>

<head>
<title><fmt:message key="commodityForm.title" /></title>
<meta name="heading"
	content="<fmt:message key='commodityForm.heading'/>" />
<meta name="menu" content="commodityFormMenu" />
<script type="text/javascript"
	src="<c:url value='/scripts/jquery/ui/jquery.ui.button.js'/>"></script>
<script type="text/javascript"
	src="<c:url value='/scripts/jquery/ui/jquery.ui.datepicker.js'/>"></script>
<style>
#toolbar {
	padding: 10px 10px;
}

#toolbar2 {
	padding: 10px 10px;
}

#vesselName,#vesselCode,#vesselAge,#vesselWeight,#vesselCountry,#vesselDescription
	{
	height: 20px;
	margin-right: 20px;
	margin-top: 12px;
}
</style>
</head>

<div class="buttons"
	style="float: left; padding-right: 15px; margin-top: 20px;">
	<form:form commandName="commodity" method="post"
		action="commodityForm.html" onsubmit="return onFormSubmit(this)"
		id="commodityForm">
		<form:hidden path="id" />
		<fieldset class="ui-widget ui-widget-content"
			style="width: 100%; margin-top: 12px; margin-bottom: 12px;">

			<legend class="ui-widget-header ui-corner-all">
				<fmt:message key="commodityForm.heading" />
			</legend>

			<table>
				<tr>
					<td><appfuse:label styleClass="desc"
							key="commodityData.commodityType" /></td>
					<td><form:errors path="commodityType" cssClass="fieldError" />
						<form:select path="commodityType" items="${commodityTypeList}"
							itemLabel="name" itemValue="id"
							class="select ui-widget-content ui-corner-all" /></td>
				</tr>
				<tr>
					<td><appfuse:label styleClass="desc" key="commodityData.code" />
					</td>
					<td><form:errors path="code" cssClass="fieldError" /> <form:input
							path="code" id="commodityCode"
							class="ui-widget-content ui-corner-all"
							cssErrorClass="text large error" /></td>
				</tr>
				<tr>
					<td><appfuse:label styleClass="desc" key="commodityData.name" />
					</td>
					<td><form:errors path="name" cssClass="fieldError" /> <form:input
							path="name" id="commodityName"
							class="ui-widget-content ui-corner-all"
							cssErrorClass="text large error" /></td>
				</tr>
			</table>
			<span id="toolbar">
				<button type="submit" id="add_maven2" class="button" name="save"
					onclick="bCancel=false">
					<fmt:message key="button.save" />
				</button> <c:if test="${param.from == 'list' and param.method != 'Add'}">
					<button type="submit" id="delete_maven2" class="button"
						name="delete"
						onclick="bCancel=true;return confirmDelete('Commodity Data')">
						<fmt:message key="button.delete" />
					</button>
				</c:if>

				<button type="submit" id="cancel_maven2" class="button"
					name="cancel" onclick="bCancel=true"
					value="<fmt:message key="button.cancel"/>" /> <fmt:message
					key="button.cancel" />
				</button>
			</span>
		</fieldset>

	</form:form>
</div>

<script type="text/javascript">
	$("#add_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-plus"
	    }
	});
	
	$("#delete_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-minus"
	    }
	});
	
	$("#cancel_maven" ).button({
	    icons: {
	        primary: "ui-icon-circle-close"
	    }
	});
	
	$("#add_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-plus"
	    }
	});
	
	$("#delete_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-minus"
	    }
	});
	
	$("#cancel_maven2" ).button({
	    icons: {
	        primary: "ui-icon-circle-close"
	    }
	});
</script>